#include "RS.h"

namespace graphics
{

/****************
RS
****************/
RS::RS(){
	RS_Type = RS_NOSTATE;
}
/****************
RS_AlphaBlend
****************/
RS_AlphaBlend::RS_AlphaBlend()
{
	Source = BLEND_SRCALPHA;
	Destination = BLEND_INVSRCALPHA;
	RS_Type = RS_ALPHABLEND;
}

void RS_AlphaBlend::SetBlendDst(BlendType value)
{
	Destination = value;
}
void RS_AlphaBlend::SetBlendSrc(BlendType value)
{
	Source = value;
}

/****************
RS_Material
****************/
RS_Material::RS_Material()
{
	Emissive	= D3DCOLOR_XRGB(0,0,0);
	Ambient		= D3DCOLOR_XRGB((int)(255*0.2),(int)(255*0.2),(int)(255*0.2));
	Diffuse		= D3DCOLOR_XRGB((int)(255*0.8),(int)(255*0.8),(int)(255*0.8));
	Specular	= D3DCOLOR_XRGB(0,0,0);
	Shininess	= 1;

	RS_Type = RS_MATERIAL;
}
void RS_Material::SetEmissive (float r, float g, float b)
{
	Emissive = D3DCOLOR_XRGB((int)(255*r),(int)(255*g),(int)(255*b));;
}
void RS_Material::SetAmbient  (float r, float g, float b)
{
	Ambient = D3DCOLOR_XRGB((int)(255*r),(int)(255*g),(int)(255*b));;
}
void RS_Material::SetDiffuse  (float r, float g, float b)
{
	Diffuse = D3DCOLOR_XRGB((int)(255*r),(int)(255*g),(int)(255*b));;
}
void RS_Material::SetSpecular (float r, float g, float b)
{
	Specular = D3DCOLOR_XRGB((int)(255*r),(int)(255*g),(int)(255*b));;
}
void RS_Material::SetShininess(float level)
{
	Shininess = level;
}

}/* namespace graphics */